package com.design.memento.clone;

/**
 * @ClassName Client.java
 * @Description Clone方式的备忘录
 * @author Jon
 * @date 2018年6月20日 下午5:28:40
 */
public class Client {
	public static void main(String[] args) throws CloneNotSupportedException {
		Originator originator = new Originator();
		originator.setStatus("A");
		System.out.println("初始状态是：" + originator.getStatus());
		//建立备份
		originator.createMemento();
		originator.setStatus("B");
		System.out.println("修改后状态是：" + originator.getStatus());
		originator.restoreMemento();
		System.out.println("恢复后状态是：" + originator.getStatus());
	}
}
